package cn.blogsx.lambda.demo01;

public class Demo01Runable {
    public static void main(String[] args) {
        //普通方式开启多线程
        RunableImpl runable = new RunableImpl();
        Thread t = new Thread(runable);
        t.start();

        //简化代码,使用匿名内部类,实现多线程程序
       Runnable r= new Runnable(){
            @Override
            public void run(){
                System.out.println(Thread.currentThread().getName()+" 新线程创建了");
            }
        };
        new Thread(r).start();

        //简化代码
        new Thread(new Runnable(){
            @Override
            public void run(){
                System.out.println(Thread.currentThread().getName()+" 新线程创建了");
            }
        }).start();
    }
}
